<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <p>{{timer}}</p>
        <button :disabled="xx">点击</button>
    </div>

    <script src="./js/vue.js"></script>
    <script>
        let app = new Vue({
            el:"#app",
            data:{
                timer: 10,
                xx: true
            },
            mounted() {
                let num = 10;
                let trm = setInterval(()=>{
                    num--;
                    this.timer = num;
                    if(this.timer == 0){
                       this.xx = false;
                       clearInterval(trm);
                    }
                },1000);
            }
        });
    </script>
</body>
</html>